from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from merchant.apps.business.models import *


class BusinessTypeAdmin(admin.ModelAdmin):
	prepopulated_fields = {'slug': ('name',)}


class BusinessAdmin(admin.ModelAdmin):
	fieldsets = (
		(None, {'fields': ('business_type','name','slug','description',)}),
		(_(u'Location'), {'fields': ('address1','address2','city','state','zip_code','country',)}),
		(_(u'Contact info'), {'fields': ('phone1','phone2','mobile','fax','tty','website','email',)}),
		(_(u'Geocoding'), {'fields': ('latitude','longitude',)}),
		(_(u'Misc'), {'fields': ('validated','notes',)}),
	)
	list_display = ('name','business_type','address1','city','state','zip_code','phone1','validated')
	list_filter = ('business_type','validated')
	search_fields = ('name','description','notes')
	prepopulated_fields = {'slug': ('name',)}


admin.site.register(Business, BusinessAdmin)
admin.site.register(BusinessType, BusinessTypeAdmin)